package org.example.HttpClient.impl;

import org.example.HttpClient.HttpInterface.HttpController;
import org.example.HttpClient.Pojo.AxiosConfig;

//构建
public class JAxiosBuild {

    private final JAxiosUtils Controller;

    public JAxiosBuild(JAxiosUtils controller) {
        Controller = controller;
    }

    public HttpController Request(String url,String method){
        Controller.axiosConfig = new AxiosConfig();
        Controller.axiosConfig.setUrl(url);
        Controller.axiosConfig.setMethod(method);
        return Controller;
    }

    public HttpController Get(String url){
        return Request(url,"GET");
    }

    public HttpController Post(String url){
        return Request(url,"POST");

    }

    public HttpController Put(String url){
        return Request(url,"PUT");

    }

    public HttpController Delete(String url){
        return Request(url,"DELETE");

    }

    public HttpController Patch(String url){
        return Request(url,"PATCH");

    }

    public HttpController  Options(String url){
        return Request(url,"OPTIONS");

    }

    public HttpController Trace(String url){
        return Request(url,"TRACE");

    }

    public HttpController Head(String url){
        return Request(url,"HEAD");
    }
}
